package 笔记.equals与双等于号;

public class Demo02 {
    public static void main(String[] args) {
        String s1 = "abc";
        String s2 = "abc";
        System.out.println(s1 == s2);

        String s3 = new String("abc");
        String s4 = new String("abc");
        System.out.println(s3 == s4);
        System.out.println(s3.equals(s4));

        Dog dog1 = new Dog("二狗", "白色");
        Dog dog2 = new Dog("二狗", "白色");
        System.out.println(dog1.equals(dog2));

    }
}
